﻿
using Dapper;
using hdb;
using hentity;
using System;
using System.Collections.Generic;
using System.Data;
namespace hwms {
    public class WcsMoveTask : WcsBaseEngine
    {
        public long completeId;
        public long paramId;
        public String waveNo;
        public int src;
        public int des;
        protected override TransRes Execute(IDbConnection connection, IDbTransaction transaction )
        {
            CoreTask complete = new CoreTask();
            complete.id = completeId;
            complete.boxCode = "";
            complete.des = des;
            complete.src = src;
            complete.info = "从" + src + "到" + des;
            complete.createTime = DateTime.Now;
            complete.waveNo = waveNo;
            connection.InsertNoNull(complete,transaction);
            CoreTaskParam completeParam = new CoreTaskParam();
            completeParam.id = paramId;
            completeParam.taskId = complete.id;
            completeParam.param = "";
            completeParam.type = ( int ) TaskParamType.托盘搬运;
            completeParam.des = des;
            completeParam.src = src;
            completeParam.cStn = src;
            completeParam.status = ( int ) CoreTaskParamStatus.可以接收任务;
            completeParam.taskNo = BBTaskNo(connection ,transaction);
            connection.InsertNoNull(completeParam,transaction);
           

            return new TransRes(); 
        }
    }
}
